package com.heima.ec_platform;

import java.util.ArrayList;

public class ECommerceSystem implements ECommercePlatform{
    private ArrayList<Product> list;

    public ECommerceSystem(ArrayList<Product> list) {
        this.list = list;
    }

    @Override
    public void addProduct(Product product) {
        list.add(product);
    }

    @Override
    public void displayProducts() {
        for (int i = 0; i < list.size(); i++) {
            Product p = list.get(i);
            p.display();
        }

    }
}
